﻿using System.Collections;
using System.Collections.Generic;
using Const;
using UnityEngine;
using Entitas;
using Entitas.CodeGeneration.Attributes;
using EventType = Entitas.CodeGeneration.Attributes.EventType;

namespace Components
{
    [Game,Unique]
    public class GameBoardComponents : IComponent
    {
        /// <summary>
        /// 列
        /// </summary>
        public int columns;
        /// <summary>
        /// 行
        /// </summary>
        public int raws;
    }

    [Game]
    public class ItemComponent : IComponent
    {
        //如果在Component里面不创建变量，那么他就默认为布尔类型(bool)的值
    }

    [Game,Event(EventTarget.Self,EventType.Added,1)]
    public class ItemIndex:IComponent
    {
        [EntityIndex]
        public customData index;
    }

    [Game, Event(EventTarget.Self)]
    public class DestroyComponent : IComponent
    {
        //销毁Item
        //如果在Component里面不创建变量，那么他就默认为布尔类型(bool)的值
    }
    
    [Game,Event(EventTarget.Any)]
    public class LoadPrefab:IComponent
    {
        public string Path;
    }

    [Game]
    public class Movable : IComponent
    {
        //标记是否可以移动，为真则为Item，为假就是block;
        //如果在Component里面不创建变量，那么他就默认为布尔类型(bool)的值
    }

    [Game]
    public class ExchangeComponent : IComponent
    {
        public ExchangeState exchangeState;
    }

    [Game]
    public class MoveCompleteComponent : IComponent
    {
        //用来标记运动完成
        //如果在Component里面不创建变量，那么他就默认为布尔类型(bool)的值
    }

    [Game]
    public class GetSameColor : IComponent
    {
        //状态标记
        //如果在Component里面不创建变量，那么他就默认为布尔类型(bool)的值
    }

    [Game]
    public class DetecteSameItem : IComponent
    {
        public List<IEntity> LeftEntities;
        public List<IEntity> RightEntities;
        public List<IEntity> UpEntities;
        public List<IEntity> DownEntities;
    }

    [Game]
    public class Eliminate : IComponent
    {
        public bool isEliminate;
    }

    [Game]
    public class JudgeFormation : IComponent
    {
        //状态标记
        //如果在Component里面不创建变量，那么他就默认为布尔类型(bool)的值
    }

    [Game]
    public class ItemEffectState : IComponent
    {
        public ItemEffectName EffectState;
    }

    [Game,Event(EventTarget.Self)]
    public class LoadSprite : IComponent
    {
        public string SpriteName;
    }

    [Game,Unique,Event(EventTarget.Self)]
    public class Score : IComponent
    {
        public int score;
    }

    [Game, Unique, Event(EventTarget.Self)]
    public class goal : IComponent
    {
        public int Goal;
    }

    
    
    [Game,Event(EventTarget.Self)]
    public class Audio : IComponent
    {
        public string path;
    }

    [Game]
    public class FallState : IComponent
    {
        public fallState state;
    }
}